/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUIComponents;
import MainClasses.*;
import MainClasses.Event.*;
import javax.swing.*;
import java.util.*;
import java.awt.Color;
/**
 *
 * @author andrewcutler
 */
public class DayPanel extends JPanel{
    
    public DayPanel(MyDate date, Course c)
    {
        this.setBorder(BorderFactory.createLineBorder(Color.black));
        this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
        ArrayList<Event> assignments = c.getEvents();
        
        for(Event a : assignments)
        {
            MyDate dateDue = a.getEndDate();
            if(dateDue.equals(date))
            {
                this.add(a.getPanel());
            }
        }
    }

}
